import { getWordContent } from "../../api"

const state = {
  dataList: [],
}
const mutations = {
  GETDATALIST(state, dataList) {
    state.dataList = dataList
  },
}
const actions = {
  async getDataList({ commit }) {
    let res = await getWordContent()
    if (res.code === 200) {
      commit("GETDATALIST", res.data)
    }
  },
}
const getters = {
  dataList(state) {
    return state.dataList
  },
}
export default {
  state,
  mutations,
  actions,
  getters,
}
